package tech.aistar.mapper;

import org.apache.ibatis.annotations.*;
import tech.aistar.pojo.Flower;

import java.util.List;

@Mapper
public interface FlowerMapper {
    //按flower查询
    @Select("select * from flower where flower_id=#{id}")
    Flower findById(int id);
    //按name，user，material，category，count查询
    List<Flower> findByOther(String name,String use,String material,String category,Integer count);
    //增加
//    @Insert("insert into flower(name,use,material,category,count,price,image)values(#{name},#{use},#{material},#{category},#{count},#{price},#{image})")
//    int insert(Flower flower);
    @Insert("insert into flower(name,`use`,material,category,count,price,image) values(#{name},#{use},#{material},#{category},#{count},#{price},#{image})")
    int insertFlower(Flower flower);
    //修改更新
//    @Update("")
    int updateFlower(Flower flower);
    //删除
    @Delete("delete from flower where flower_id=#{id}")
    int deleteFlower(int id);
}
